home *** CD-ROM | disk | FTP | other *** search
- //------------------------------------------------------------------------------
- // File: $$CLASS_NAME$$.h
- //
- // Desc: DirectMusicTool Wizard generated code - Definition of $$CLASS_NAME$$
- //
- // Author: $$TOOL_AUTHOR$$
- //
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //------------------------------------------------------------------------------
-
- /////////////////////////////////////////////////////////////////////////////
- // TODO List:
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- // - Add the DMTool parameters to the $$TOOLID_NAME$$FilterParams enumeration
- // - Provide information about the DMTool parameters in the g_params array
- $$ENDIF
- // - Add memeber variables / functions
- //
- /////////////////////////////////////////////////////////////////////////////
-
- #ifndef __$$CLASS_NAME$$_H_
- #define __$$CLASS_NAME$$_H_
-
- #include "resource.h"
- #define FIX_LOCK_NAME
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- #include "param.h" // (param.h must come before uuids to avoid redefinitions)
- $$ENDIF
- #include "dmusici.h"
- #include "$$DLL_NAME$$.h" // $$TOOL_NAME$$ Interface
-
- $$IF(SUPPORT_DM_DMP) // If supports DirectMusic Producer
- #define FOURCC_TOOL_CHUNK mmioFOURCC($$TOOL_RIFF_ID$$)
- $$ENDIF // End => if supports DirectMusic Producer
- $$IF(!EMPTY_TOOL) // Sample tool
- #define MAX_ECHOES 4
- #define N_8TH DMUS_PPQ / 2 // Length of an 8th note
- $$ENDIF // End => Sample tool
-
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- ///////////////////////////////////////////////////////////////////////////////
- // Parameter Info
- //
- const MP_CAPS g_capsAll = MP_CAPS_CURVE_JUMP | MP_CAPS_CURVE_LINEAR | MP_CAPS_CURVE_SQUARE | MP_CAPS_CURVE_INVSQUARE | MP_CAPS_CURVE_SINE;
-
- // TODO: Add the DMTOOL parameters to the enumeration
- enum $$TOOLID_NAME$$FilterParams
- {
- $$IF(EMPTY_TOOL)
- $$TOOL_DEFINE$$_PARAM1 = 0, // NOTE: $$TOOL_DEFINE$$_PARAM1 is provided as an example
- $$ELSE // Sample DMTool
- ECHO_NUMBER = 0,
- ECHO_DELAY,
- $$ENDIF
- };
-
- ///////////////////////////////////////////////////////////////////////////////
- // The ParamInfo struct is defined as:
- // typedef struct _ParamInfo
- // {
- // DWORD dwIndex; // Index for the parameter
- // MP_PARAMINFO MParamInfo; // Parameter info
- // WCHAR * pwchText; // Text name for the parameter
- // } ParamInfo;
- ///////////////////////////////////////////////////////////////////////////////
- // TODO: Provide information about the DMTool parameters
- static ParamInfo g_params[] =
- {
- // index type caps min, max, neutral, unit text, label, parameter name
- $$IF(EMPTY_TOOL)
- $$TOOL_DEFINE$$_PARAM1,MPT_INT, g_capsAll, 0, 100, 0, L"units", L"Param1", L"Param1",
- $$ELSE // Sample DMTool
- ECHO_NUMBER, MPT_INT, g_capsAll, 1, 4, 3, L"", L"Number", L"Number",
- ECHO_DELAY, MPT_INT, g_capsAll, 1, 1000, N_8TH, L"", L"Delay", L"Delay",
- $$ENDIF
- };
- ///////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////
- $$ENDIF
-
- /////////////////////////////////////////////////////////////////////////////
- // $$CLASS_NAME$$
- class ATL_NO_VTABLE $$CLASS_NAME$$ :
- public CComObjectRootEx<CComMultiThreadModel>,
- public CComCoClass<$$CLASS_NAME$$, &CLSID_$$TOOL_DEFINE$$>,
- public IDirectMusicTool8,
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- public CParamsManager,
- public CParamsManager::UpdateCallback,
- public IPersistStream,
- $$ENDIF
- $$IF(SUPPORT_DM_DMP)
- public ISpecifyPropertyPages,
- $$ENDIF
- public $$INTERFACE_NAME$$
- {
- public:
- $$CLASS_NAME$$(); // Constructor
- ~$$CLASS_NAME$$(); // Destructor
-
- DECLARE_REGISTRY_RESOURCEID(IDR_$$TOOL_DEFINE$$)
- DECLARE_GET_CONTROLLING_UNKNOWN()
-
- DECLARE_PROTECT_FINAL_CONSTRUCT()
-
- BEGIN_COM_MAP($$CLASS_NAME$$)
- COM_INTERFACE_ENTRY_IID(IID_IDirectMusicTool, IDirectMusicTool)
- COM_INTERFACE_ENTRY_IID(IID_IDirectMusicTool8, IDirectMusicTool8)
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- COM_INTERFACE_ENTRY(IMediaParams)
- COM_INTERFACE_ENTRY(IMediaParamInfo)
- COM_INTERFACE_ENTRY(IPersistStream)
- $$ENDIF
- $$IF(SUPPORT_DM_DMP)
- COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
- $$ENDIF
- COM_INTERFACE_ENTRY_IID(IID_$$INTERFACE_NAME$$, $$INTERFACE_NAME$$)
- COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
- END_COM_MAP()
-
- HRESULT FinalConstruct()
- {
- return CoCreateFreeThreadedMarshaler(
- GetControllingUnknown(), &m_pUnkMarshaler.p);
- }
-
- void FinalRelease()
- {
- m_pUnkMarshaler.Release();
- }
-
- CComPtr<IUnknown> m_pUnkMarshaler;
-
- public:
- // IDirectMusicTool
- STDMETHODIMP Init(IDirectMusicGraph* pGraph) ;
- STDMETHODIMP GetMsgDeliveryType(DWORD* pdwDeliveryType ) ;
- STDMETHODIMP GetMediaTypeArraySize(DWORD* pdwNumElements ) ;
- STDMETHODIMP GetMediaTypes(DWORD** padwMediaTypes, DWORD dwNumElements) ;
- STDMETHODIMP ProcessPMsg(IDirectMusicPerformance* pPerf, DMUS_PMSG* pDMUS_PMSG) ;
- STDMETHODIMP Flush(IDirectMusicPerformance* pPerf, DMUS_PMSG* pDMUS_PMSG, REFERENCE_TIME rt) ;
-
- // IDirectMusicTool8
- STDMETHODIMP Clone( IDirectMusicTool ** ppTool) ;
-
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- // SetParam handling
- STDMETHODIMP SetParam(DWORD dwParamIndex,MP_DATA value) { return SetParamInternal(dwParamIndex, value, false); }
- HRESULT SetParamUpdate(DWORD dwParamIndex, MP_DATA value) { return SetParamInternal(dwParamIndex, value, true); }
- HRESULT SetParamInternal(DWORD dwParamIndex, MP_DATA value, bool fSkipPasssingToParamManager);
-
- // IPersist Methods
- STDMETHODIMP STDMETHODCALLTYPE GetClassID(CLSID* pClassID);
-
- // IPersistStream Methods
- STDMETHODIMP STDMETHODCALLTYPE IsDirty();
- STDMETHODIMP STDMETHODCALLTYPE Load(IStream* pStream);
- STDMETHODIMP STDMETHODCALLTYPE Save(IStream* pStream, BOOL fClearDirty);
- STDMETHODIMP STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER* pcbSize);
- $$ENDIF
-
- $$IF(SUPPORT_DM_DMP)
- // ISpecifyPropertyPages Methods
- STDMETHODIMP GetPages(CAUUID *pPages);
- $$ENDIF
-
- // $$INTERFACE_NAME$$ Methods
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- STDMETHOD(SetAllParameters) (THIS_ LPC$$TOOLID_NAME$$Params pParm);
- STDMETHOD(GetAllParameters) (THIS_ LP$$TOOLID_NAME$$Params pParm);
- $$ENDIF
-
- $$IF(EMPTY_TOOL)
- // TODO: Add your custom interface methods here
-
- $$ELSE // Sample Tool
- // IEchoTool
- STDMETHODIMP_(void) SetEchoNum( DWORD dwEchoNum );
- STDMETHODIMP_(void) SetDelay( MUSIC_TIME mtDelay );
- $$ENDIF
-
- private:
- // States of the DMTool
- $$IF(SUPPORT_DM_IMEDPARAM || SUPPORT_DM_DMP)
- bool m_fDirty;
- $$ENDIF
- bool m_fInitialized;
-
- $$IF(EMPTY_TOOL)
- // TODO: Declare memeber variables here. m_dwParam1 is provided as an example
- DWORD m_dwParam1; // TODO: Rename this variable to your friendly name
-
- $$ELSE // Sample Tool
- DWORD m_dwEchoNum; // Number of echoes to generate
- MUSIC_TIME m_mtDelay; // Delay time between echoes
- $$ENDIF
- };
-
- #endif //__$$CLASS_NAME$$_H_
-
-